import { createStore } from 'vuex';
import app from './modules/app';
import user from './modules/user';
import tagsView from './modules/tagsView';
import permission from './modules/permission';
import settings from './modules/settings';
import getters from './getters';

import createPersistedstate from 'vuex-persistedstate';

const store = createStore({
    modules: {
        app,
        user,
        tagsView,
        permission,
        settings,
    },
    getters,
    plugins: [
        //默认是存储在localStorage中
        createPersistedstate({
            // key: 存储数据的键名
            key: 'longStore',
            //paths:存储state中的那些数据
            paths: ['tagsView'],
        }),
    ],
});
export default store;
